package com.neusoft.springrestful.controller;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * 
 * @author chens
 *
 */
@Controller
@RequestMapping("/admin")
public class AdminController {
	private Logger logger = Logger.getLogger(AdminController.class);

	/**
	 * 使用restful地址传参，参数名使用大括号包含起来；并在方法的参数使用@PathVariable进行参数指定
	 * 
	 * 控制的另一种返回值类型：ModelAndView，可以在spring mvc中进行参数和页面的传递F
	 * 
	 * @param page
	 * @param size
	 * @return
	 */
	@RequestMapping("/list/{page}/{size}")
	public ModelAndView list(@PathVariable(value = "page") Integer page, @PathVariable(value = "size") Integer size) {
		ModelAndView view = new ModelAndView("admin_list");

		logger.info(page + "  +++++     " + size);

		return view;
	}

}
